Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font overview phase 1 #1849

Merged
merged 91 commits into from
Dec 22, 2024
Merged

Font overview phase 1 #1849

merged 91 commits into from
Dec 22, 2024

Conversation

ollimeier
Copy link
Collaborator

@ollimeier ollimeier commented Dec 11, 2024

Part of #102

This implements a very basic font overview. It needs some followups for refinement, but the core functionality is there and mergable.

@ollimeier ollimeier force-pushed the issue-102-font-overview branch from cf8c6cd to b815bb7 Compare December 11, 2024 04:46
@ollimeier
Copy link
Collaborator Author

@justvanrossum

TODOs and Questions:

  1. I am wondering if it would make sense to refactor GlyphsSearch into two web components:
    1. GlyphsSearch: Includes the search field, only. Access the list of glyphs with eg. glyphsListItemsController.
    2. GlyphsSearchForEditor which uses GlyphsSearch and adds the glyph list.
  2. We may want to move sortedSourceIdentifiers to a more general location like utils. Follow up task?
  3. Do we want to make the sidebar scalable? If so, we may want to refactor sidebar-resize-gutter or at least have a look at it. Follow up task?
  4. Context menu is implemented in the overview, yet. We may want to add them. Is this a follow up task?
  5. Maybe use https://www.npmjs.com/package/unicode-properties for overview sections. Also, how to we handle unencoded glyphs? Follow up task?
  6. Add top menu bar, please see: [font overview] Menu bar for font overview #1845
  7. When opening a glyph in the editor via double click, there is an error: It says error while interpolating font sources '{message: 'objects have incompatible number of entries: 7 != 6', type: 'interpolation-error'}'. But this is not true. I don't know why this is happening.

@ollimeier
Copy link
Collaborator Author

Little demo of the current stage:

fontra-font-overview-sneak-preview.mp4

@justvanrossum
Copy link
Collaborator

Next steps:

  • Figure out "cell view" API,
    • getSelectedGlyphNames()
    • setSelectedGlyphNames()
    • addEventListener("selectionChanged", (event) => ...)
  • Selection behavior:
    • Click to select glyph
    • Shift click to deselect glyph, or add glyph to selection
    • Click-drag, to "paint" selection? Can be followup.
    • Arrow key navigation. Can be followup.
    • Typing a character (and glyphname?) selects the matching glyph. Can be followup.
  • Fix cell layout so cells "flow" ("inline block"), see "Related Glyphs" panel
  • Fix cell glyph load/draw so it only loads once the cell becomes visible (currently it seems all glyphs are loaded, also the ones outside the scroll area)

Question:

  • Should the cell view be an accordion view, so sections can be folded/hidden?

@justvanrossum
Copy link
Collaborator

Minor bug: double clicking the / glyph results in an empty canvas. Since it is the prefix for glyph names, if you want to type a slash, it should be doubled. So I think we should special-case the / to become // in the text entry.

@justvanrossum justvanrossum force-pushed the issue-102-font-overview branch from c12e8c7 to e75682d Compare December 15, 2024 20:51
@ollimeier ollimeier force-pushed the issue-102-font-overview branch from c12e8c7 to 033e7fa Compare December 15, 2024 21:18
@ollimeier ollimeier force-pushed the issue-102-font-overview branch from 033e7fa to a22e41d Compare December 15, 2024 21:20
@justvanrossum
Copy link
Collaborator

justvanrossum commented Dec 16, 2024

I made a small change to glyph-cell.js, that fixes the lazy loading: d510469. You should notice a vast improvement in performance, as only glyphs that are in view will be loaded.

One small bug that I don't quite understand: in Egitto, double-clicking on the "tulip" glyph does not open the right glyph. Maybe the source data contains ambiguous code points. Ohh, the code point is U+1F337, so this may again be a UTF-16 issue. It was, and I fixed it.

@justvanrossum
Copy link
Collaborator

By default, I think the default source should be selected. You can easily get it with the fontController.fontSourcesInstancer.defaultSourceIdentifier property.

We should store the selected source identifier in the URL fragment.

@justvanrossum justvanrossum changed the title Font overview Font overview phase 1 Dec 22, 2024
@justvanrossum justvanrossum marked this pull request as ready for review December 22, 2024 15:32
@justvanrossum justvanrossum merged commit 29f1209 into main Dec 22, 2024
5 checks passed
@justvanrossum justvanrossum deleted the issue-102-font-overview branch December 22, 2024 19:03
@justvanrossum justvanrossum mentioned this pull request Dec 22, 2024
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants